/**
 * Create in 2012-10-13 上午12:09:58.
 */
package kit4j.app.notepad.ui.menu;

import java.awt.MenuItem;
import java.awt.MenuShortcut;
import java.awt.event.KeyEvent;

import kit4j.app.notepad.command.ExitCommand;
import kit4j.app.notepad.command.NotepadCommandExecutor;
import kit4j.app.notepad.config.NotepadConfig;
import kit4j.app.notepad.ui.listener.ExecuteCommandActionListener;

/**
 * 
 * @author MiniKnife
 * 
 */
public class ExitMenuItem extends MenuItem {

	private static final long serialVersionUID = 1L;

	public ExitMenuItem(NotepadConfig config, NotepadCommandExecutor commandExecutor) {
		super(config.getString("MENU_EXIT_LABEL", "Exit"));

		setShortcut(new MenuShortcut(KeyEvent.VK_X, false));
		addActionListener(new ExecuteCommandActionListener(new ExitCommand(), commandExecutor));
	}

}
